package cn.iocoder.yudao.module.book.dal.mysql.author;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.book.dal.dataobject.author.AuthorDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.book.controller.admin.author.vo.*;

/**
 * 作者 Mapper
 *
 *
 */
@Mapper
public interface AuthorMapper extends BaseMapperX<AuthorDO> {

    default PageResult<AuthorDO> selectPage(AuthorPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<AuthorDO>()
                .likeIfPresent(AuthorDO::getName, reqVO.getName())
                .eqIfPresent(AuthorDO::getBiography, reqVO.getBiography())
                .betweenIfPresent(AuthorDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(AuthorDO::getId));
    }

}